Skip to main content

All Questions

Tagged with
0votes
0answers
52views

Using comma separated list to ssh [duplicate]

Following on https://unix.stackexchange.com/a/511859/374303, whose answer is: while IFS=, read -r IP ID NAME; do echo "ssh $IP myprogram $ID $NAME" done < testfile.txt However, my ...
xpt's user avatar
  • 1,808
-1votes
3answers
162views

How to ssh, su , maintain the session and make effects only to my session environment?

I want to SSH into a remote server (Amazon Linux 2) and simultaneously execute su and some commands, while also maintaining the SSH session in a single script like this: ssh -t ec2-user@$host -i $...
tom's user avatar
  • 21
0votes
1answer
445views

Correct way to set PS1 prompt over ssh

I am trying to set the PS1 prompt dynamically on the my remote machine. The idea is that when I will do ssh to the remote machine, I will also send the value which will set as a prompt for that remote ...
sachu's user avatar
0votes
1answer
198views

How to interrupt a running command in linux and continue from the last state later?

I run a sh script on terminal of linux remote server using ssh which will take very long. I need to power off my machine and I want to save the current state of execution and continue later from the ...
heyula's user avatar
0votes
1answer
1kviews

ssh EOF in bash script - how to store value of command?

I need to basically copy only the last created folder in a directory of many folders within an SSH session. I have the correct find command to do this, but I just can't seem to store the result within ...
Ben Whitely's user avatar
1vote
1answer
274views

ssh <host> bash -c 'cmd' , why is first line of output lost? [duplicate]

Why am I losing shell command output? (in this case via ssh to an Ubuntu Raspberry Pi) $ ssh [email protected] bash -l -c 'echo 111' SSH is enabled and the default password for the 'pi' user has not ...
user48956's user avatar
0votes
1answer
90views

Run a bash script located in remote VM

I have two VMs, Vm-A & Vm-B. I have two scripts: one in VM-A & another in VM-B VM-A has a bash script which gets CPU% every second & saves it to a variable $cpu. VM-B has a bash script ...
ph3ro's user avatar
0votes
0answers
1kviews

Shell script to login to remote server and execute further commands

I am automating something with Shell Script. And as a part of this, I need shell script to ssh to a remote server, change the hostname of remote server, modify a folder name keeping its contents as it ...
serverstackqns's user avatar
0votes
0answers
175views

SSH connection from A to B, then B connects to A

I would like to connect in Rsync to a client that is already connected to my server via ssh. Let's say I have client A connecting to client B via SSH, what I would like to do is establish an Rsync ...
JJWRX's user avatar
1vote
1answer
184views

Extract linux (admin) users report for remote hosts [closed]

I am trying to find the best way to extract a report of Linux users and also which one of them are admin. The targets are Debian (8,9) and Ubuntu (18,20). The final report would be very long, so I ...
RookieRoo's user avatar
0votes
1answer
220views

how get ssh awk remote values

im using this script [test@sys-master ~]$ parallel -k -j 100 sshpass -p test1213'!' ssh -oStrictHostKeyChecking=no -oCheckHostIP=no -q [email protected].{} "cat /proc/loadavg | awk -F \" \" '{...
morris__'s user avatar
1vote
2answers
3kviews

what are tty files for?

Can someone explain me what are the tty files? I can't understand that, using the command : echo 1 > /dev/tty prints to my current terminal the output: 1, but if i try to use echo 1 > /dev/tty0 ...
hamza's user avatar
0votes
1answer
148views

Setting environmental variable in linux via ssh

I am working on three different issues so I have cloned source code in three different directories. 1) /nobackup/vivek/dev1/<source_code>.. 2) /nobackup/vivek/dev2/<source_code>.. 3) /...
sachu's user avatar
0votes
1answer
656views

LINUX - Last login for root user

on a redhat server I logged with my domain username, and then switched as root. As I switched as root I received the message for the last login for root (Last login: ....). I am asking if the "...
user avatar
0votes
0answers
49views

Multiple group commands in ssh

What I want to do is enter server A via ssh, run multiple group commands in parallel, exit and enter server B and repeat etc etc. echo "Entered node21" ssh -T node21 << EOF { { sh ...
hangbin jo's user avatar

153050per page
close